home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Papers / From CodeWarrior to Delphi / TalkBASIC / Example 1 -- A simple pgm next >
Encoding:
Text File  |  1996-11-28  |  225 b   |  10 lines  |  [TEXT/?BAS]

  1. MsgBox("This program adds up numbers, up to the number you specify")
  2.  
  3. topnumber = val(inputbox$("Add up to what number?"))
  4.  
  5. total = 0
  6. for number = 1 to topnumber
  7.    total = total + number
  8. next
  9.  
  10. MsgBox("The total is " + total)